package com.meizi.drop.springboot.websocket.k8s.config;

import com.meizi.drop.springboot.websocket.k8s.hander.TestWebSocketHandler;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;

/**
 * @author meizi
 * @email enjoymeizi@gmail.com
 * @date 2021/1/14 13:17
 */
@Configuration
@EnableWebSocket
public class WebSocketConfigImpl implements WebSocketConfigurer {
    @Override
    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
            registry.addHandler(new TestWebSocketHandler(),"websocket/test").setAllowedOrigins("*");
    }
}
